VERSION = 0.01
LIBNYB-NET = libnyb-net.so
OBJS  = libnyb-net_socket.o
OBJS += libnyb-net_interface.o
INCLUDES = -I. -I./include
CFLAGS = -Wall -Os -g

DIR_LIB = /usr/local/lib
DIR_INCLUDE = /usr/local/include/libnyb



.PHONY: all

all: $(LIBNYB-NET)

$(LIBNYB-NET): $(OBJS)
	$(CC) -fPIC -shared $(OBJS) -o $(LIBNYB-NET)

%.o: %.c
	$(CC) -fPIC -c $< -o $@ $(INCLUDES) $(CFLAGS)

install:
	mkdir -p $(DIR_LIB)
	mkdir -p $(DIR_INCLUDE)
	cp $(LIBNYB-NET) $(DIR_LIB)/$(LIBNYB-NET)
	cp libnyb-net.h  $(DIR_INCLUDE)/libnyb-net.h
	ldconfig

uninstall:
	rm $(DIR_LIB)/$(LIBNYB-NET)
	rm -rf $(DIR_INCLUDE)
	ldconfig


.PHONY: clean

clean:
	rm -rf $(LIBNYB-NET) $(OBJS)



